home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / business / pb016.dms / pb016.adf / Config!Z < prev    next >
Text File  |  1992-06-18  |  57KB  |  2,111 lines

  1. -----------------------------------------------------------------------------
  2. |                              Config!Z                                        |
  3. |         Copyright (C) 1986-92 Rick Stiles.  All rights reserved.            |
  4. -----------------------------------------------------------------------------
  5.  
  6. ======= NEW or CHANGED CMDS in Uedit V3.0 =======
  7.  
  8.  
  9. HYPER TEXT in Config!H has been rewritten.
  10.  
  11. INCLUDE Config!H here when considering cmds that have been modified for V3.0.
  12.  
  13. *************************************
  14. N-variables used:
  15. n0-n19 scratch numbers
  16.  
  17. Buffers used:
  18. buf51-54    scratch buffers
  19.  
  20. buf37    copied columnar text
  21. buf38    directory names
  22. buf41    swap buf
  23. buf43    filename buf
  24. buf45    UNDO buffer
  25. buf46    invert buf
  26. buf47    hilite buf
  27. buf48    replace text
  28. buf49    search string
  29. buf99    stack buf
  30.  
  31. *************************************
  32.  
  33. <defines:
  34. define(N_0 ,n0)
  35. define(N_1 ,n1)
  36. define(N_2 ,n2)
  37. define(N_3 ,n3)
  38. define(N_4 ,n4)
  39. define(N_5 ,n5)
  40. define(N_6 ,n6)
  41. define(N_7 ,n7)
  42. define(N_8 ,n8)
  43. define(N_9 ,n9)
  44. define(N_10 ,n10)
  45. define(N_11 ,n11)
  46. define(N_12 ,n12)
  47. define(N_13 ,n13)
  48. define(N_14 ,n14)
  49. define(N_15 ,n15)
  50. define(N_16 ,n16)
  51. define(N_17 ,n17)
  52. define(N_18 ,n18)
  53. define(n_19 ,n19)
  54.  
  55. define(B_0 ,buf50)
  56. define(B_1 ,buf51)
  57. define(B_2 ,buf52)
  58. define(B_3 ,buf53)
  59. define(B_4 ,buf54)
  60.  
  61. define(COLUMNAR_BUF ,buf37)
  62. define(DIR_NAMES    ,buf38)
  63. define(SWAP_BUF ,buf41)
  64. define(FILE_NAME    ,buf43)
  65. define(UNDO_BUF ,buf45)
  66. define(INVERT_BUF    ,buf46)
  67. define(HILITE_BUF    ,buf47)
  68. define(REPLACE_TXT ,buf48)
  69. define(SEARCH_STR    ,buf49)
  70. define(BUF_99    ,buf99)
  71.  
  72. define(BSTACK_99    ,buf99) .. note buf99 isn't really used
  73. define(NSTACK_99    ,n99)    .. note n99 isn't really used
  74.  
  75. define(Eat_MouseUp_Input    ,624)
  76. >
  77.  
  78. Multiple document search
  79. <alt-f9:
  80.     equateNum(N_4,curFile)
  81.     equateLoc(curFile,locA,atCursor)
  82.  
  83.     while (not runKey(normal-f9)) {
  84.         moveCursor(curFile,locA)
  85.         updateDisplay
  86.         toggle(curFile)
  87.         if (eqNum(N_4,curFile)) returnFalse
  88.         equateLoc(curFile,locA,atCursor)
  89.         moveCursor(curFile,sFile)
  90.     }
  91. >
  92.  
  93. Replace matched region with replace text, then search fwd in all files
  94. <ctl-f10:
  95.     if (eqLoc(curFile,sInvert,eInvert)) returnFalse
  96.     clearRgn(curFile,invert)
  97.     insertRgn(curFile,sInvert,REPLACE_TXT,all)
  98.     runKey(alt-f9) >
  99.  
  100. Replace and fwd search-replace in all files until search fails
  101. <shftAlt-f10: while(runKey(ctl-f10)) nothing >
  102.  
  103. Set up conditions to fold a file
  104. <lAmiga-\:
  105.     define(LHS_COLOR,0)
  106.     define(RHS_COLOR,9)
  107.     define(TITLE_COLOR,9)
  108.     define(CMT_COLOR,9)
  109.     define(BG_COLOR,0)
  110.     putMsg("")
  111.  
  112.     text("",0,0,BG_COLOR,-2)
  113.  
  114.     while (nothing) {
  115. label(4)
  116.         gosub label(0) .. show current tests on LHS
  117.         gosub label(1) .. show options on RHS
  118.         putMsg("Testing step [1-16] (0=quit):")
  119.         inputNum(N_18)
  120.         if (geNum(0,N_18)) goto label(3)
  121.         if (gtNum(17,N_18)) {
  122.             putMsg("Testing option [1-15] (0=back,-1=clear step):")
  123.             inputNum(N_7)
  124.             if (eqNum(N_7,0)) goto label(4)
  125.             if (gtNum(0,N_7)) { setFold(N_18,0,0,0) goto label(4) }
  126.             if (geNum(N_7,16)) goto label(4)
  127.             freeBuf(B_4)
  128.             equateNum(N_8,0)
  129.             if (gtNum(8,N_7)) {         .. 1-7, need num
  130.                 putMsg("X=indent or X=length value [0-130] (-1=back)")
  131.                 inputNum(N_8)
  132.                 if (gtNum(0,N_8)) goto label(4)
  133.                 if (gtNum(N_8,130)) equateNum(N_8,130)
  134.             } else if (gtNum(11,N_7)) { .. 8-10 need 1-4 chars
  135.                 putMsg("X = 1-4 characters:")
  136.                 if (!inputString(B_4)) goto label(4)
  137.                 fileSize(B_4,N_4)
  138.                 if (eqNum(N_4,0)) goto label(4)
  139.             } else {                    .. 11-15 need 2 chars
  140.                 putMsg("X = 2 characters for range or brackets:")
  141.                 if (!inputString(B_4)) goto label(4)
  142.                 fileSize(B_4,N_4)
  143.                 if (!eqNum(N_4,2)) goto label(4)
  144.             }
  145.             putMsg("SKA value (0=skip, 1=keep, 2=AND with next step):")
  146.             inputNum(N_9)
  147.             if (gtNum(0,N_9) | gtNum(N_9,2)) goto label(4)
  148.             if (gtNum(8,N_7)) setFold(N_18,N_7,N_8,N_9)
  149.             else setFold(N_18,N_7,B_4,N_9)
  150.         }
  151.     }
  152. label(3)
  153.     fullRefresh
  154.     putMsg(" ") putMsg("")
  155.     return
  156.  
  157. label(1) .. SUBROUTINE: display test options on RHS
  158.     text("Testing Options",3,46,TITLE_COLOR,0)
  159.     do (N_0,1,15) {
  160.         gosub label(2)
  161.         add(N_10,N_0,3)
  162.         if (gtNum(N_0,9)) text(N_0,N_10,46,RHS_COLOR,0)
  163.         else text(N_0,N_10,47,RHS_COLOR,0)
  164.         text(B_4,N_10,50,RHS_COLOR,0)
  165.     }
  166.     incNum(N_10)
  167.     text("(Strings use X = \"abcd\" ...)",N_10,48,CMT_COLOR,0)
  168.     incNum(N_10)
  169.     text("(Ranges use X = \"AZ\", \"09\" ...)",N_10,48,CMT_COLOR,0)
  170.     incNum(N_10)
  171.     text("(Rgns use X = \"[]\", \"{}\" ...)",N_10,48,CMT_COLOR,0)
  172.     return
  173.  
  174. label(0) .. SUBROUTINE: display current steps on LHS
  175.     text("Current Testing Steps",3,1,TITLE_COLOR,0)
  176.     text("X",3,34,TITLE_COLOR,0)
  177.     text("SKA",3,40,TITLE_COLOR,0)
  178.     do (N_3,1,16) {
  179.         getFold(N_3,N_0,N_1,B_3,N_2)
  180.         gosub label(2)
  181.         add(N_10,N_3,3)
  182.         if (gtNum(N_3,9)) text(N_3,N_10,1,CMT_COLOR,0)
  183.         else text(N_3,N_10,2,CMT_COLOR,0)
  184.         equateNum(N_11,31)
  185.         if (!eqNum(N_0,0)) {
  186.             if (gtNum(N_3,9)) equateNum(N_11,30)
  187.             text(B_4,N_10,4,LHS_COLOR,N_11)
  188.             if (!eqNum(N_0,1)) {
  189.                 if (gtNum(N_0,7)) text(B_3,N_10,34,LHS_COLOR,0)
  190.                 else text(N_1,N_10,34,LHS_COLOR,0)
  191.             }
  192.             if (eqNum(N_2,0)) text("Skip",N_10,40,LHS_COLOR,0)
  193.             else
  194.             if (eqNum(N_2,1)) text("Keep",N_10,40,LHS_COLOR,0)
  195.             else
  196.             if (eqNum(N_2,2)) text("AND",N_10,40,LHS_COLOR,0)
  197.         } else text("",N_10,4,LHS_COLOR,40)
  198.     }
  199.  
  200. label(2) .. SUBROUTINE: put test msg into B_4 for test in N_0
  201.     clearBuf(B_4)
  202.     switch (N_0) {
  203.     case(1)  { insertRgn(B_4,eFile,"blank line",all) }
  204.     case(2)    { insertRgn(B_4,eFile,"indent = X",all) }
  205.     case(3)    { insertRgn(B_4,eFile,"indent < X",all) }
  206.     case(4)    { insertRgn(B_4,eFile,"indent > X",all) }
  207.     case(5)    { insertRgn(B_4,eFile,"line-length = X",all) }
  208.     case(6)    { insertRgn(B_4,eFile,"line-length < X",all) }
  209.     case(7)    { insertRgn(B_4,eFile,"line-length > X",all) }
  210.     case(8)    { insertRgn(B_4,eFile,"1-4 char string X in line",all) }
  211.     case(9)    { insertRgn(B_4,eFile,"1-4 char string X at SOL",all) }
  212.     case(10)  { insertRgn(B_4,eFile,"1-4 char string X is at EOL",all) }
  213.     case(11)  { insertRgn(B_4,eFile,"char in range X in line",all) }
  214.     case(12)  { insertRgn(B_4,eFile,"char in range X at SOL",all) }
  215.     case(13)  { insertRgn(B_4,eFile,"char in range X at EOL",all) }
  216.     case(14)  { insertRgn(B_4,eFile,"bounded rgn in line",all) }
  217.     case(15)  { insertRgn(B_4,eFile,"bounded rgn in multi-lines",all) }
  218.     }
  219. >
  220.  
  221. Fold current file
  222. <rAmiga-\:
  223.     getFileName(B_4,curFile)
  224.     insertRgn(B_4,eFile,".fold",all)
  225.     if (fold("",curFile,all)) {
  226.         setFileName(curFile,B_4)
  227.         downFlag(curFile,changed)
  228.     }
  229. >
  230.  
  231. Set colors
  232. <alt-help:
  233.     inputKey(N_5)
  234.     while (nothing) {
  235.         gosub label(0)
  236.         putMsg("# of color (0-15) to change (ESC=quit):")
  237.         if (!inputNum(N_5)) {
  238.             refreshDisplay
  239.             putMsg("")
  240.             return
  241.         }
  242.         if (geNum(N_5,0) & geNum(15,N_5)) {
  243.             putMsg("Fg color value (0-3)?")
  244.             inputNum(N_7)
  245.             if (geNum(N_7,0) & geNum(3,N_7)) {
  246.                 putMsg("Bg color value (0-3)?")
  247.                 inputNum(N_6)
  248.                 if (geNum(N_6,0) & geNum(3,N_6)) {
  249.                     if (eqNum(N_6,N_7)) {
  250.                         putMsg("Fg == Bg is NOT ALLOWED")
  251.                         delay(10)
  252.                     } else {
  253.                         setColors(curFile,N_5,N_7,N_6)
  254.                         setColors(" ",N_5,N_7,N_6)   .. so new buf's inherit these
  255.                     }
  256.                     if (eqNum(N_5,8)) {
  257.                         toggle(toTiny)
  258.                         toggle(toTiny)
  259.                     }
  260.                     if (eqNum(N_5,10)) runKey(startup)
  261.                     updateDisplay
  262.                 }
  263.             }
  264.         }
  265.     }
  266.  
  267. label(0)  ..subroutine to demonstrate current color settings
  268.     equateNum(N_3,1)
  269.     equateNum(N_5,0)
  270.     do (N_4,2,21) {
  271.         text("",N_4,18,N_3,41)
  272.         if (gtNum(N_4,3) & gtNum(21,N_4) & !eqNum(N_4,12)) {
  273.             if (gtNum(N_5,9)) text(N_5,N_4,19,N_3,0)
  274.             else text(N_5,N_4,20,N_3,0)
  275.             text("< >  < >",N_4,49,N_3,0)
  276.             incNum(N_5)
  277.         }
  278.     }
  279.     equateNum(N_0,0)
  280.     do (N_4,4,20) {
  281.         if (!eqNum(N_4,12)) {
  282.             getColors(curFile,N_0,N_1,N_2)
  283.             text(N_1,N_4,50,N_3,0)
  284.             text(N_2,N_4,55,N_3,0)
  285.             incNum(N_0)
  286.         }
  287.     }
  288.     text("#       ((( For Files )))     Fg   Bg",3,20,N_3,0)
  289.     text("normal text",  4,23,0,0)
  290.     text("cursor",  5,23,1,0)
  291.     text("hilite",  6,23,2,0)
  292.     text("cursor + hilite",  7,23,3,0)
  293.     text("invert",  8,23,4,0)
  294.     text("invert+cursor",  9,23,5,0)
  295.     text("hilite+invert",  10,23,6,0)
  296.     text("cursor+hilite+invert",  11,23,7,0)
  297.     text("        ((( For Screen )))",12,20,N_3,0)
  298.     text("title bar",  13,23,8,0)
  299.     text("msg line",  14,23,9,0)
  300.     text("menus",  15,23,10,0)
  301.     text("tab ruler",  16,23,11,0)
  302.     text("requester",  17,23,12,0)
  303.     text("formfeed",  18,23,13,0)
  304.     text("spare1",  19,23,14,0)
  305.     text("spare2",  20,23,15,0)
  306. >
  307.  
  308. Set screen dimensions
  309. <lAmiga-f2:
  310.     push(NSTACK_99,sWidth)
  311.     push(NSTACK_99,sHeight)
  312.     putMsg("Enter new screen width <640>:")
  313.     inputNum(N_4)
  314.     if (eqNum(N_4,0)) equateNum(N_4,640)
  315.     if (gtNum(N_4,1024)) equateNum(N_4,1024)
  316.     else
  317.     if (gtNum(400,N_4)) equateNum(N_4,400)
  318.     putMsg("Enter new screen height <200> (if INTERLACE 200 X 2=400 is automatic):")
  319.     inputNum(N_3)
  320.     if (eqNum(N_3,0)) equateNum(N_3,200)
  321.     if (gtNum(N_3,1024)) equateNum(3,1024)
  322.     else
  323.     if (gtNum(50,N_3)) equateNum(N_3,50)
  324.     equateNum(sWidth,N_4)
  325.     equateNum(sHeight,N_3)
  326.     toggle(toTiny) toggle(toTiny)
  327.     if (askYesNo("Restore original dimensions?")) {
  328.         pop(NSTACK_99,sHeight)
  329.         pop(NSTACK_99,sWidth)
  330.         toggle(toTiny) toggle(toTiny)
  331.     } else {
  332.         pop(NSTACK_99,N_4)
  333.         pop(NSTACK_99,N_4)
  334.     }
  335. >
  336.  
  337. RGB color set 1
  338. <lamiga-esc:
  339.     setRGB(0x005a,0x0fff,0x0f90,0x009f)
  340. >
  341. RGB color set 2
  342. <ramiga-esc:
  343.     setRGB(0x005a,0x0fff,0x0fa0,0x0a55)
  344. >
  345. RGB color set 3
  346. <virtual-esc:
  347.     setRGB(0x0bb0,0x0000,0x0fff,0x0f80)
  348. >
  349.  
  350. Change the RGB color register values
  351. <alt-esc:
  352.     define(Reg0 ,N_10)    ..NOTE: register n-vars must be contiguous (N_10-N_13)
  353.     define(Reg1 ,N_11)
  354.     define(Reg2 ,N_12)
  355.     define(Reg3 ,N_13)
  356.     define(KReg0 ,N_14)
  357.     define(KReg1 ,N_15)
  358.     define(KReg2 ,N_16)
  359.     define(KReg3 ,N_17)
  360.  
  361.     define(REGISTER ,N_6)
  362.     define(CURCOLOR ,N_7)
  363.  
  364.     define(REG_NUM ,N_0)
  365.  
  366.     define(OFFSET ,N_1)
  367.     define(ROW ,N_2)
  368.  
  369.     define(RGB_RED ,N_3)
  370.     define(RGB_GREEN ,N_4)
  371.     define(RGB_BLUE ,N_5)
  372.  
  373.     define(COLOR_1 ,2)
  374.     define(COLOR_2 ,1)
  375.  
  376.     define(XN_10 ,N_8)
  377.     define(XN_11 ,N_9)
  378.  
  379.     define(TUNE_COLOR,label(0))
  380.     define(COLORMSG ,label(1))
  381.     define(FINISHED ,label(2))
  382.  
  383.     push(NSTACK_99,Reg0)  push(NSTACK_99,Reg1)  push(NSTACK_99,Reg2)  push(NSTACK_99,Reg3)
  384.     push(NSTACK_99,KReg0) push(NSTACK_99,KReg1) push(NSTACK_99,KReg2) push(NSTACK_99,KReg3)
  385.     push(NSTACK_99,REGISTER) push(NSTACK_99,CURCOLOR)
  386.  
  387.     getRGB(Reg0,Reg1,Reg2,Reg3)
  388.     getRGB(KReg0,KReg1,KReg2,KReg3)
  389.  
  390.     do (ROW,1,15) text("",ROW,15,COLOR_1,49)
  391.     text(">>>> Tune RBG Color Registers <<<<",2,23,COLOR_2,0)
  392.  
  393.     text("R:",5,18,COLOR_1,0)
  394.     text("G:",6,18,COLOR_1,0)
  395.     text("B:",7,18,COLOR_1,0)
  396.  
  397.     text("Test Test ",9,20,1,0)
  398.     text("Test Test ",9,-1,2,0)
  399.     text("Test Test ",9,-1,3,0)
  400.     text("Test Test ",9,-1,4,0)
  401.     text("      ARROW keys: new selection",11,20,COLOR_1,0)
  402.     text("SHIFT ARROW keys: inc/dec color value",12,20,COLOR_1,0)
  403.     text("     ESC/Q/CLICK: use new colors",13,20,COLOR_1,0)
  404.     text("   any other key: restore old colors",14,20,COLOR_1,0)
  405.  
  406.     equateNum(REGISTER,0)
  407.     equateNum(CURCOLOR,0)
  408.     while (nothing) {
  409.         GOSUB COLORMSG
  410.         getKey(XN_10)
  411.         switch (XN_10) {
  412.             case(normal-buttonDown)
  413.             case(normal-esc)
  414.             case(normal-q) { GOTO FINISHED }
  415.             case(normal-upArrow)
  416.                 { decNum(CURCOLOR)
  417.                   if (gtNum(0,CURCOLOR)) equateNum(CURCOLOR,2) }
  418.             case(normal-downArrow)
  419.                 { incNum(CURCOLOR)
  420.                   if (gtNum(CURCOLOR,2)) equateNum(CURCOLOR,0) }
  421.             case(normal-leftArrow)
  422.                 { decNum(REGISTER)
  423.                   if (gtNum(0,REGISTER)) equateNum(REGISTER,3) }
  424.             case(normal-rightArrow)
  425.                 { incNum(REGISTER)
  426.                   if (gtNum(REGISTER,3)) equateNum(REGISTER,0) }
  427.  
  428.             case(shft-upArrow)
  429.                 { equateNum(XN_11,1) GOSUB TUNE_COLOR }
  430.             case(shft-downArrow)
  431.                 { equateNum(XN_11,-1) GOSUB TUNE_COLOR }
  432.             case(shft-leftArrow)
  433.                 { equateNum(XN_11,-1) GOSUB TUNE_COLOR }
  434.             case(shft-rightArrow)
  435.                 { equateNum(XN_11,1) GOSUB TUNE_COLOR }
  436.             default        { setRGB(KReg0,KReg1,KReg2,KReg3)
  437.                                       GOTO FINISHED }
  438.         }
  439.         while (inputKey(XN_10)) nothing
  440.     }
  441. FINISHED
  442.     pop(NSTACK_99,CURCOLOR) pop(NSTACK_99,REGISTER)
  443.     pop(NSTACK_99,KReg3) pop(NSTACK_99,KReg2) pop(NSTACK_99,KReg1) pop(NSTACK_99,KReg0)
  444.     pop(NSTACK_99,Reg3)  pop(NSTACK_99,Reg2)  pop(NSTACK_99,Reg1)  pop(NSTACK_99,Reg0)
  445.     putMsg(" ") putMsg("")
  446.     fullRefresh
  447.     return
  448.  
  449.  
  450. TUNE_COLOR ..SUBROUTINE to inc/dec a register color value
  451.  
  452.     equateNum(XN_10,n[REGISTER])
  453.     and(RGB_BLUE,XN_10,15) div(XN_10,XN_10,16)
  454.     and(RGB_GREEN,XN_10,15) div(XN_10,XN_10,16)
  455.     and(RGB_RED,XN_10,15)
  456.  
  457.     switch(CURCOLOR) {
  458.         case(0) { equateNum(XN_10,RGB_RED) }
  459.         case(1) { equateNum(XN_10,RGB_GREEN) }
  460.         case(2) { equateNum(XN_10,RGB_BLUE) }
  461.     }
  462.     add(XN_10,XN_10,XN_11)
  463.     if (gtNum(XN_10,15)) equateNum(XN_10,0)
  464.     else if (gtNum(0,XN_10)) equateNum(XN_10,15)
  465.  
  466.     switch(CURCOLOR) {
  467.         case(0) { equateNum(RGB_RED,XN_10) }
  468.         case(1) { equateNum(RGB_GREEN,XN_10) }
  469.         case(2) { equateNum(RGB_BLUE,XN_10) }
  470.     }
  471.  
  472.     equateNum(XN_10,RGB_RED)
  473.     mul(XN_10,XN_10,16)
  474.     or(XN_10,XN_10,RGB_GREEN)
  475.     mul(XN_10,XN_10,16)
  476.     or(XN_10,XN_10,RGB_BLUE)
  477.  
  478.     equateNum(n[REGISTER],XN_10)
  479.     return
  480.  
  481.  
  482. COLORMSG    ..SUBROUTINE to setRGB & display RGB color register contents
  483.     setRGB(Reg0,Reg1,Reg2,Reg3)
  484.  
  485.  
  486.     do (REG_NUM,0,3) {
  487.         equateNum(ROW,4)
  488.         mul(OFFSET,REG_NUM,10)
  489.         add(OFFSET,OFFSET,22)
  490.  
  491.         text("Reg ",ROW,OFFSET,COLOR_1,0)
  492.         text(REG_NUM,ROW,-1,COLOR_1,0)
  493.         text(":",ROW,-1,COLOR_1,0)
  494.         incNum(ROW)
  495.  
  496.         equateNum(XN_10,n[REG_NUM])
  497.         and(RGB_BLUE,XN_10,15) div(XN_10,XN_10,16)
  498.         and(RGB_GREEN,XN_10,15) div(XN_10,XN_10,16)
  499.         and(RGB_RED,XN_10,15)
  500.  
  501.         equateNum(XN_10,COLOR_1)
  502.         if (eqNum(CURCOLOR,0) & eqNum(REG_NUM,REGISTER)) equateNum(XN_10,COLOR_2)
  503.         text("  ",ROW,OFFSET,COLOR_1,0)
  504.         text(RGB_RED,ROW,OFFSET,XN_10,0)
  505.         incNum(ROW)
  506.         equateNum(XN_10,COLOR_1)
  507.         if (eqNum(CURCOLOR,1) & eqNum(REG_NUM,REGISTER)) equateNum(XN_10,COLOR_2)
  508.         text("  ",ROW,OFFSET,COLOR_1,0)
  509.         text(RGB_GREEN,ROW,OFFSET,XN_10,0)
  510.         incNum(ROW)
  511.         equateNum(XN_10,COLOR_1)
  512.         if (eqNum(CURCOLOR,2) & eqNum(REG_NUM,REGISTER)) equateNum(XN_10,COLOR_2)
  513.         text("  ",ROW,OFFSET,COLOR_1,0)
  514.         text(RGB_BLUE,ROW,OFFSET,XN_10,0)
  515.         incNum(ROW)
  516.     }
  517. >
  518.  
  519. Place cursor or scroll if button held; hilite with double click
  520. <normal-buttonDown:                    .. This cmd was created by  Ken Perano
  521.     ..putmsg(clicktime)
  522.     if (eqLoc(curFile,atCursor,mouseLoc) & geNum(40,clickTime) ) {
  523.                                       .. (0.40 sec) double-clicked, so hilite
  524.         equateLoc(curFile,locA,mouseLoc)  .. save cur cursor location in locA
  525.         getSplitLines(N_2,N_3)               .. determine row range of window
  526.         getFont(B_4,N_1,N_4)                      .. N_4 = character height
  527.         add(N_2,N_2,2)                                      .. top row number
  528.         add(N_3,N_3,2)                                   .. bottom row number
  529.         mul(N_2,N_2,N_4)                            .. N_2 = top pixel number
  530.         mul(N_3,N_3,N_4)                         .. N_3 = bottom pixel number
  531.  
  532.         if (not mouseDown) return
  533.         while (not inputWaiting) {
  534.             trackMouse
  535.             if (gtLoc(curFile,locA,mouseLoc)) {   .. update Hilite definition
  536.                 equateLoc(curFile,sHilite,mouseLoc)
  537.                 equateLoc(curFile,eHilite,locA)
  538.             } else {
  539.                 equateLoc(curFile,eHilite,mouseLoc)
  540.                 equateLoc(curFile,sHilite,locA)
  541.             }
  542.             mouseXY(N_4,N_0)     .. scroll only if mouse is in scroll regions
  543.             if (geNum(N_0,N_3)) {                 .. mouse at bottom of screen
  544.                 vscroll(2)                         .. speed up this direction
  545.                 updateDisplay
  546.             } else if (geNum(N_2,N_0)) {            .. mouse at top of screen
  547.                 vscroll(-1)
  548.                 updateDisplay
  549.             } else                                           .. do not scroll
  550.             refreshDisplay
  551.         }
  552.         equateLoc(curFile,atCursor,sHilite)        .. cleanup work on mouseup
  553.         refreshDisplay
  554.         .. runKey(normal-kpDot)                 .. auto-copy Hilite to buffer
  555.     } else {                                    .. standard scrolling feature
  556.         moveCursor(curFile,mouseLoc)
  557.         updateDisplay
  558.         mouseXY(N_1,N_2)
  559.         if (not mouseDown) return
  560.         while (not inputWaiting) {
  561.             trackMouse
  562.             mouseXY(N_3,N_4)
  563.             sub(N_4,N_4,N_2)
  564.             div(N_4,N_4,5)       ..  could increase 5 to decrease sensitivity
  565.             vscroll(N_4)                            ..  multi-speed scrolling
  566.             updateDisplay
  567.         }
  568.     }
  569. >
  570.  
  571. Set start of hilite region
  572. <shft-buttonDown:
  573.     if (getFlag(curFile,columnar)) {
  574.         runKey(shftAltCtl-buttonDown)
  575.         equateLoc(curFile,sHilite,atCursor)
  576.     } else equateLoc(curFile,sHilite,mouseLoc)
  577.     refreshDisplay >
  578.  
  579. Set end of hilite region
  580. <alt-buttonDown:
  581.     if (getFlag(curFile,columnar)) {
  582.         runKey(shftAltCtl-buttonDown)
  583.         equateLoc(curFile,eHilite,atCursor)
  584.     } else equateLoc(curFile,eHilite,mouseLoc)
  585.     refreshDisplay >
  586.  
  587. Set start of invert region
  588. <shftCtl-buttonDown:
  589.     if (getFlag(curFile,columnar)) {
  590.         runKey(shftAltCtl-buttonDown)
  591.         equateLoc(curFile,sInvert,atCursor)
  592.     } else equateLoc(curFile,sInvert,mouseLoc)
  593.     refreshDisplay >
  594.  
  595. Set end of invert region
  596. <altCtl-buttonDown:
  597.     if (getFlag(curFile,columnar)) {
  598.         runKey(shftAltCtl-buttonDown)
  599.         equateLoc(curFile,eInvert,atCursor)
  600.     } else equateLoc(curFile,eInvert,mouseLoc)
  601.     refreshDisplay >
  602.  
  603. Place cursor - pad line with spaces to extend it if necessary
  604. <shftAltCtl-buttonDown:
  605.     equateLoc(curFile,locA,atCursor)
  606.     equateLoc(curFile,atCursor,mouseLoc)
  607.     equateNum(N_4,0)
  608.     if (!is(curFile,eLine)) equateNum(N_4,1)
  609.     if (eqNum(N_4,1)) returnFalse
  610.     equateLoc(curFile,atCursor,locA)
  611.  
  612.     mouseXY(N_1,N_2)
  613.     getFont(B_4,N_11,N_0)
  614.     div(N_1,N_1,N_11)
  615.     moveCursor(curFile,mouseLoc)
  616.     while (is(curFile,space)) clearChar(curFile)
  617.     locToCol(curFile,N_3,atCursor)
  618.     decNum(N_3)
  619.     if (gtNum(N_1,N_3)) {
  620.         sub(N_1,N_1,N_3)
  621.         if (eqNum(N_1,1)) goto label(2)
  622.         while (decNum(N_1)) insertChar(curFile," ")
  623.     } else {
  624.         label(2)
  625.         while (is(curFile,space)) clearChar(curFile)
  626.         while (nothing) {
  627.             moveCursor(curFile,sChar)
  628.             if (!is(CurFile,space)) { moveCursor(curFile,eChar) goto label(1) }
  629.             clearChar(curFile)
  630.         }
  631.         label(1)
  632.     }
  633.     updateDisplay
  634.     >
  635.  
  636. Find & process filenames with *? wildcards, loading all files that match
  637. <shftAltCtl-z:
  638.     getSearch(B_4)               .. save current search string & searchCaps
  639.     push(BSTACK_99,B_4)
  640.     push(NSTACK_99,searchCaps)
  641.     equateNum(searchCaps,0)
  642.  
  643.     getMaxFiles(N_3)                                          .. get maxfiles
  644.     decNum(N_3)
  645.     equateNum(N_11,-1)
  646.     equateNum(N_0,0)              .. count files loaded and pushed onto stack
  647.  
  648.     if (!thiskey) {                               .. being run by startup cmd
  649.         do (N_4,0,N_3) {
  650.             if (getFileName(B_4,buf[N_4])) {
  651.                 moveCursor(B_4,sFile)
  652.                 while ( !is(B_4,"*")
  653.                             & !is(B_4,"?")
  654.                                 & moveCursor(B_4,eChar)) nothing
  655.                 if (!is(B_4,eFile) & isEmpty(buf[N_4])) {
  656.                     equateNum(N_11,N_4)             .. so won't free buf below
  657.                     gosub label(50)                    .. load wildcard files
  658.                 }
  659.             }
  660.             clearBuf(B_4)
  661.         }
  662.     } else {
  663.         putMsg("Enter filename-wildcard*? mask to use in loading files")
  664.         freebuf(B_4)
  665.         if (inputString(B_4) & not isEmpty(B_4)) {
  666.             moveCursor(B_4,sFile)
  667.             while (!is(B_4,"*")
  668.                 & !is(B_4,"?")
  669.                     & moveCursor(B_4,eChar)) nothing
  670.             if (!is(B_4,eFile)) gosub label(50) .. load wildcard files
  671.         }
  672.     }
  673.  
  674.     .. now load the files
  675.     equateNum(N_1,0)
  676.     while (gtNum(N_0,0) & geNum(N_3,N_1)) {
  677.         if (isEmpty(buf[N_1]) | eqNum(N_11,N_1)) {
  678.             pop(BSTACK_99,buf[N_1])
  679.             decNum(N_0)
  680.             if (eqNum(N_1,N_11)) equateNum(N_11,-1)
  681.             gosub label(49)     .. free buffer with * or ? in title if exists
  682.         }
  683.         incNum(N_1)
  684.     }
  685.     .. see if had enough file slots
  686.     if (gtNum(N_0,0)) {
  687.         putMsg("Exceeded MaxFiles, so not all were loaded")
  688.         while (gtNum(N_0,0)) { pop(BSTACK_99,B_4) decNum(N_0) }
  689.     }
  690.  
  691.     gosub label(49)
  692.     pop(NSTACK_99,searchCaps)         .. restore searchCaps & original search string
  693.     pop(BSTACK_99,B_4)
  694.     setSearch(B_4)
  695.     freeBuf(B_4)
  696.     freeBuf(B_3)
  697.     freeBuf(B_2)
  698.     freeBuf(B_0)
  699.     return
  700.  
  701. label(49) ..SUBROUTINE to free buf[N_11] if need to
  702.     if (geNum(N_11,0)) freeBuf(buf[N_11])
  703.     equateNum(N_11,-1)
  704.     return
  705.  
  706. label(50) ..SUBROUTINE: Process filename with wildcards in B_4, loading files
  707.           .. look for * and replace with #? for Dir
  708.     moveCursor(B_4,sFile)
  709.  
  710. label(0)
  711.     if (is(B_4,"*")) {
  712.         clearChar(B_4)
  713.         insertChar(B_4,"#")
  714.         insertChar(B_4,"?")
  715.         goto label(0)
  716.     }
  717.     if (moveCursor(B_4,eChar)) goto label(0)
  718.  
  719.     .. capture dirname, if any - will later prepend to all filenames
  720.     moveCursor(B_4,sFile)
  721.     equateLoc(B_4,locA,atCursor)
  722.     equateLoc(B_4,locB,atCursor)
  723. label(1)
  724.     if (is(B_4,":") | is(B_4,"/")) equateLoc(B_4,locB,atCursor)
  725.     if (moveCursor(B_4,eChar)) goto label(1)
  726.  
  727.     equateNum(N_2,0)
  728.     freeBuf(B_0)
  729.     if (not eqLoc(B_4,locB,locA)) {
  730.         moveCursor(B_4,locB)
  731.         moveCursor(B_4,eChar)                             .. jump the : or /
  732.         equateLoc(B_4,locB,atCursor)
  733.         equateLoc(B_4,locA,sFile)
  734.         insertRgn(B_0,eFile,B_4,loc)                  .. capture dir name
  735.         incNum(N_2)                          .. indicates there was a dirname
  736.     }
  737.  
  738.     insertRgn(B_4,sfile,"List ",all)
  739.     clearBuf(B_3)
  740.     execute(B_3,B_4)               .. run CLI List program, get filenames
  741.  
  742.     .. delete first and maybe last line, these aren't filenames
  743.     if (gtNum(N_2,0)) {                                .. there was a dirname
  744.         movecursor(B_3,sFile)           .. delete first line if need to here
  745.         clearRgn(B_3,line)
  746.         clearChar(B_3)
  747.     }
  748.     moveCursor(B_3,eFile)
  749.     moveCursor(B_3,sLine)
  750.     clearRgn(B_3,line)
  751.     clearChar(B_3)
  752.     if (isEmpty(B_3)) returnFalse
  753.  
  754.     .. delete all lines corresponding to Dir names
  755.     moveCursor(B_3,sFile)
  756.     setSearch(" Dir ")
  757.     while (search(B_3,locA,locB,1)) {
  758.         moveCursor(B_3,sLine)
  759.         clearRgn(B_3,line)
  760.         clearChar(B_3)
  761.     }
  762.     if (isEmpty(B_3)) returnFalse
  763.  
  764.     sortLines(B_3,0)
  765.  
  766.     .. capture filenames, prepend dirname, load files
  767.     moveCursor(B_3,eFile)
  768.     setSearch("   ")
  769.     while (moveCursor(B_3,sLine) & search(B_3,locA,locB,1)) {
  770.         clearRgn(B_3,line)                          .. clear to end of line
  771.         moveCursor(B_3,sLine)                             ..capture filename
  772.         freeBuf(B_2)
  773.         insertRgn(B_2,eFile,B_0,all)                   .. prepend dirname
  774.         insertRgn(B_2,eFile,B_3,line)
  775.         clearRgn(B_3,line)
  776.         if (geNum(N_3,N_0) & loadFile(B_2)) {
  777.             equateNum(N_5,0)                     .. don't keep non-text files
  778.             equateNum(N_6,0)
  779.             while (gtNum(100,N_6)) {
  780.                 copyChar(curFile,N_7)
  781.                 if ((geNum(N_7,32) & geNum(126,N_7))
  782.                   | (geNum(N_7,10) & geNum(13,N_7))) incNum(N_5)
  783.                 if (!moveCursor(curFile,eChar)) equateNum(N_6,100)
  784.                 incNum(N_6)
  785.             }
  786.             movecursor(curfile,sfile)
  787.             mul(N_5,N_5,100)
  788.             div(N_5,N_5,N_6)
  789.             if (gtNum(75,N_5)) freebuf(curFile)
  790.             else if (push(BSTACK_99,curFile)) incNum(N_0)
  791.         }
  792.     }
  793. >
  794.  
  795. Restore current file to original
  796. <shftCtl-f1:
  797.     if (!askYesNo("Load this file from disk?")) returnFalse
  798.     if (getFileName(FILE_NAME,curFile)) {
  799.         if (getFlag(curFile,readonly)) {
  800.             ..putMsg("File is marked READONLY")
  801.             if (thisKey & !askYesNo("Can I turn off the READONLY flag & load file?"))
  802.                 returnFalse
  803.             downFlag(curFile,readOnly)
  804.         }
  805.         locToIndex(curfile,N_0,sPage)
  806.         locToIndex(curfile,N_1,atcursor)
  807.         locToIndex(curfile,N_2,shilite)
  808.         locToIndex(curfile,N_3,ehilite)
  809.         locToIndex(curfile,N_4,sInvert)
  810.         push(NSTACK_99,N_4)
  811.         locToIndex(curfile,N_4,eInvert)
  812.         push(NSTACK_99,N_4)
  813.         clearRgn(curFile,all)
  814.         fileSize(curFile,N_4)
  815.         insertFile(curFile,eFile,FILE_NAME)
  816.         downFlag(curFile,changed)
  817.         indextoloc(curFile,sPage,N_0)
  818.         indextoloc(curFile,atcursor,N_1)
  819.         indextoloc(curFile,shilite,N_2)
  820.         indextoloc(curFile,ehilite,N_3)
  821.         pop(NSTACK_99,N_4)
  822.         indextoloc(curFile,einvert,N_4)
  823.         pop(NSTACK_99,N_4)
  824.         indextoloc(curFile,sinvert,N_4)
  825.         refreshDisplay
  826.     }
  827. >
  828.  
  829. Toggle a global flag or mode setting Off/On
  830. <ctl-g:
  831.     define(mouseX,N_3)
  832.     define(mouseY,N_1)
  833.     define(fontY,N_4)
  834.     define(COLORS,N_2)
  835.     inputKey(N_11)
  836.     updateDisplay
  837.     putMsg(" ") putMsg("")
  838. label(10)
  839.     equateNum(N_11,0)
  840.     getFont(B_4,N_6,fontY)
  841.     equateNum(COLORS,2)
  842.     gosub label(92)
  843.     text(" busies",1,15,COLORS,25)              text(" columnar",1,40,COLORS,25)
  844.     text(" cram",2,15,COLORS,25)                text(" customScreen",2,40,COLORS,25)
  845.     text(" hideDisplay",3,15,COLORS,25)         text(" icons",3,40,COLORS,25)
  846.     text(" learnMode",4,15,COLORS,25)            text(" markGadgets",4,40,COLORS,25)
  847.     text(" printTabs",5,15,COLORS,25)            text(" rowCol",5,40,COLORS,25)
  848.     text(" scrollType",6,15,COLORS,25)          text(" searchCaps",6,40,COLORS,25)
  849.     text(" smartTabs",7,15,COLORS,25)            text(" speakAlerts",7,40,COLORS,25)
  850.     text(" speakMsgs",8,15,COLORS,25)            text(" invisibles",8,40,COLORS,25)
  851.     text(" teachKeys",9,15,COLORS,25)            text(" trapMenus",9,40,COLORS,25)
  852.     text(" useKeys",10,15,COLORS,25)            text(" userGlobalA",10,40,COLORS,25)
  853.     text(" rexxTraffic  (UGB)",11,15,COLORS,25) text(" userGlobalC",11,40,COLORS,25)
  854.     text(" incremSearch (UGD)",12,15,COLORS,25) text(" ",12,40,COLORS,25)
  855.  
  856.     text(" ",13,15,COLORS,50)
  857.     text("-New Buffers Inherit These-",13,27,4,0)
  858.     text(" autoIndent",14,15,COLORS,25)         text(" Overstrike",14,40,COLORS,25)
  859.     text(" wordWrap",15,15,COLORS,25)            text(" rightJustify",15,40,COLORS,25)
  860.     text(" autobacKup",16,15,COLORS,25)         text(" trueTabs",16,40,COLORS,25)
  861.     text(" userlocalA",17,15,COLORS,25)         text(" Mapchars",17,40,COLORS,25)
  862.     text(" userlocalB",18,15,COLORS,25)         text(" ",18,40,COLORS,25)
  863.  
  864.     do (N_1,1,32) gosub label(91) .. get flag status
  865.     while (inputKey(N_1)) nothing
  866.     while (nothing) {
  867. label(0)
  868.         getKeyVal(N_1,N_3)
  869.         if (eqNum(N_3,27) | eqNum(N_3,32) | eqNum(N_3,10)) {
  870. label(1)
  871.             putMsg(" ")
  872.             fullRefresh
  873.             return
  874.         }
  875.         if (mouseDown) {
  876.             mouseXY(mouseX,mouseY)
  877.             if (gtNum(120,mouseX) | gtNum(mouseX,520)) goto label(1)
  878.  
  879.             inputKey(N_5)    .. collect mouseUp input
  880.             while (mouseDown) { delay(1) inputKey(N_5) }
  881.  
  882.             decnum(mouseY)
  883.             div(mouseY,mouseY,fontY)
  884.             decNum(mouseY) .. row 1-18
  885.  
  886.             if (eqNum(mouseY,12) & gtNum(mouseX,320)) goto label(1)
  887.             if (eqNum(mouseY,13)) goto label(1)
  888.  
  889.             mul(mouseY,mouseY,2)
  890.             decNum(mouseY) .. 1 3 5 7
  891.             if (gtNum(mouseX,320)) incNum(mouseY)
  892.  
  893.             if (gtNum(mouseY,24)) sub(mouseY,mouseY,3)
  894.  
  895.             if (gtNum(mouseY,32)) goto label(1)
  896.  
  897.             gosub label(90)     .. toggle flag indicated by mouseY==N_1
  898.             if (eqNum(N_11,1)) goto label(10)
  899.             if (eqNum(N_11,2)) return
  900.             gosub label(91)     .. get new flag status in N_0
  901.         } else goto label(1)
  902.     }
  903.     return
  904.  
  905. label(90)    ..SUBROUTINE to toggle flag status
  906.     switch(N_1) {
  907.     case(1) { if (eqnum(0,busies)) equatenum(busies,1)
  908.                                 else equatenum(busies,0) }
  909.     case(2) { if (!GETFLAG(curFile,columnar)) UPFLAG(curFile,columnar)
  910.                                 else DOWNFLAG(curFile,columnar)
  911.               equateNum(N_11,1) }
  912.     case(3) { if (!GETFLAG(curFile,cram)) UPFLAG(curFile,cram)
  913.                                 else DOWNFLAG(curFile,cram)
  914.               equateNum(N_11,1) }
  915.     case(4) { if (eqnum(0,customScreen)) equatenum(customScreen,1)
  916.                                 else equatenum(customScreen,0) }
  917.     case(5) { if (eqnum(0,hideDisplay)) equatenum(hideDisplay,1)
  918.                                 else { equatenum(hideDisplay,0) equateNum(N_11,1) }
  919.             }
  920.     case(6) { if (eqnum(0,icons)) equatenum(icons,1)
  921.                                 else equatenum(icons,0) }
  922.     case(7) { FLIPFLAG(curFile,learnMode)
  923.               if (getFlag(curFile,learnMode)) {
  924.                 equateNum(N_11,2)
  925.                 putMsg("LEARN MODE ACTIVE")
  926.               } else equateNum(N_11,1)
  927.               fullRefresh
  928.             }
  929.     case(8) { if (!GETFLAG(curFile,markGadgets)) UPFLAG(curFile,markGadgets)
  930.                                 else DOWNFLAG(curFile,markGadgets)
  931. label(3)
  932.               gosub label(92) }
  933.     case(9) { if (eqnum(0,printTabs)) equatenum(printTabs,1)
  934.                                 else equatenum(printTabs,0) }
  935.     case(10) { if (!GETFLAG(curFile,rowCol)) UPFLAG(curFile,rowCol)
  936.                                 else DOWNFLAG(curFile,rowCol)
  937.                                 goto label(3) }
  938.     case(11) { if (eqnum(0,scrollType)) equatenum(scrollType,1)
  939.                                 else equatenum(scrollType,0) }
  940.     case(12) { if (eqnum(0,searchCaps)) equatenum(searchCaps,1)
  941.                                 else equatenum(searchCaps,0) }
  942.     case(13) { if (eqnum(0,smartTabs)) equatenum(smartTabs,1)
  943.                                 else equatenum(smartTabs,0) }
  944.     case(14) { if (eqnum(0,speakAlerts)) equatenum(speakAlerts,1)
  945.                                 else equatenum(speakAlerts,0) }
  946.     case(15) { if (eqnum(0,speakMsgs)) equatenum(speakMsgs,1)
  947.                                 else equatenum(speakMsgs,0) }
  948.     case(16) { if (eqnum(0,spooks)) equatenum(spooks,1)
  949.                                 else equatenum(spooks,0)
  950.              refreshDisplay
  951.              equateNum(N_11,1)
  952.              }
  953.     case(17) { FLIPFLAG(curFile,teachKeys)
  954.                 equateNum(N_11,2)
  955.                 fullRefresh
  956.                 putMsg("TEACHKEYS ACTIVE (Amiga-ESC to terminate)")
  957.              }
  958.     case(18) { if (eqnum(0,trapMenus)) equatenum(trapMenus,1)
  959.                                 else equatenum(trapMenus,0) }
  960.     case(19) { if (eqnum(0,useKeys)) equatenum(useKeys,1)
  961.                                 else equatenum(useKeys,0) }
  962.     case(20) { if (eqnum(0,userGlobalA)) equatenum(userGlobalA,1)
  963.                                 else equatenum(userGlobalA,0) }
  964.     case(21) { if (eqnum(0,userGlobalB)) equatenum(userGlobalB,1)
  965.                                 else equatenum(userGlobalB,0)
  966.                 swapKey(rexxKey,virtual-t)
  967.              }
  968.     case(22) { if (eqnum(0,userGlobalC)) equatenum(userGlobalC,1)
  969.                                 else equatenum(userGlobalC,0) }
  970.     case(23) { if (eqnum(0,userGlobalD)) equatenum(userGlobalD,1)
  971.                                 else equatenum(userGlobalD,0) }
  972.  
  973.     case(24) {  if (eqNum(autoIndent,0)) equateNum(autoIndent,1)
  974.                 else equateNum(autoIndent,0) }
  975.     case(25) {  if (eqNum(overStrike,0))  equateNum(overStrike,1)
  976.                 else equateNum(overStrike,0)  }
  977.     case(26) {  if (eqNum(wordWrap,0))    equateNum(wordWrap,1)
  978.                 else equateNum(wordWrap,0) }
  979.     case(27) {  if (eqNum(rightJustify,0)) equateNum(rightJustify,1)
  980.                 else equateNum(rightJustify,0) }
  981.     case(28) {  if (eqNum(autoBackup,0))  equateNum(autoBackup,1)
  982.                 else equateNum(autoBackup,0)  }
  983.     case(29) {  if (eqNum(trueTabs,0))    equateNum(trueTabs,1)
  984.                 else equateNum(trueTabs,0)    }
  985.     case(30) {  if (eqNum(userLocalA,0))  equateNum(userLocalA,1)
  986.                 else equateNum(userLocalA,0)  }
  987.     case(31) {  if (eqNum(mapChars,0))  equateNum(mapChars,1)
  988.                 else equateNum(mapChars,0) }
  989.     case(32) {  if (eqNum(userLocalB,0))  equateNum(userLocalB,1)
  990.                 else equateNum(userLocalB,0)  }
  991.     }
  992.     return
  993.  
  994. label(91)    ..SUBROUTINE to get flag status
  995.     equateNum(N_0,0)
  996.     switch(N_1) {
  997.     case(1) { equateNum(N_0,busies) }
  998.     case(2) { if (GETFLAG(curFile,columnar)) equateNum(N_0,1) }
  999.     case(3) { if (GETFLAG(curFile,cram)) equateNum(N_0,1) }
  1000.     case(4) { equateNum(N_0,customScreen) }
  1001.     case(5) { equateNum(N_0,hideDisplay) }
  1002.     case(6) { equateNum(N_0,icons) }
  1003.     case(7) { if (GETFLAG(curFile,learnMode)) equateNum(N_0,1)  }
  1004.     case(8) { if (GETFLAG(curFile,markGadgets)) equateNum(N_0,1) }
  1005.     case(9) { equateNum(N_0,printTabs) }
  1006.     case(10) { if (GETFLAG(curFile,rowCol)) equateNum(N_0,1) }
  1007.     case(11) { equateNum(N_0,scrollType) }
  1008.     case(12) { equateNum(N_0,searchCaps) }
  1009.     case(13) { equateNum(N_0,smartTabs) }
  1010.     case(14) { equateNum(N_0,speakAlerts) }
  1011.     case(15) { equateNum(N_0,speakMsgs) }
  1012.     case(16) { equateNum(N_0,spooks) }
  1013.     case(17) { return }     .. teachKeys MUST be off
  1014.     case(18) { equateNum(N_0,trapMenus) }
  1015.     case(19) { equateNum(N_0,useKeys) }
  1016.     case(20) { equateNum(N_0,userGlobalA) }
  1017.     case(21) { equateNum(N_0,userGlobalB) }
  1018.     case(22) { equateNum(N_0,userGlobalC) }
  1019.     case(23) { equateNum(N_0,userGlobalD) }
  1020.  
  1021.     case(24) { equateNum(N_0,autoIndent)  }
  1022.     case(25) { equateNum(N_0,overStrike)  }
  1023.     case(26) { equateNum(N_0,wordWrap)    }
  1024.     case(27) { equateNum(N_0,rightJustify)}
  1025.     case(28) { equateNum(N_0,autoBackup)  }
  1026.     case(29) { equateNum(N_0,trueTabs)    }
  1027.     case(30) { equateNum(N_0,userLocalA)  }
  1028.     case(31) { equateNum(N_0,mapChars)    }
  1029.     case(32) { equateNum(N_0,userLocalB)  }
  1030.     default  { return }
  1031.     }
  1032.  
  1033.     add(N_8,N_1,1)
  1034.     if (gtNum(N_8,24)) add(N_8,N_8,3)
  1035.     div(N_9,N_8,2)
  1036.     mod(N_18,N_8,2)
  1037.  
  1038.     if (eqNum(N_18,0)) equateNum(N_18,36)
  1039.     else equateNum(N_18,61)
  1040.  
  1041.     if (eqNum(N_0,0))    text("off",N_9,N_18,COLORS,0)
  1042.     else                text("ON ",N_9,N_18,COLORS,0)
  1043.     return
  1044.  
  1045. label(92)    .. SUBROUTINE to put up msg
  1046.     text(" GLOBAL FLAGS - CLICK TO TOGGLE ",0,25,4,0)
  1047. >
  1048.  
  1049. Show description of local flags which are in title bar
  1050. <shft-f5:
  1051.     updateDisplay
  1052.     inputKey(N_4)
  1053.     text("                ^^^^^^^^^^^^ Local Buffer Flags in Title Bar",
  1054.             0,0,3,-1)
  1055.     text("                           ((Capital letter means flag is ON))",
  1056.             1,0,3,-1)
  1057.     equateNum(N_4,4)
  1058.     text("tT = trueTabs     - typing mode: use tab characters, not spaces",2,0,N_4,-1)
  1059.     text("iI = autoIndent   - typing mode: auto-indent after line-wrap or return",3,0,N_4,-1)
  1060.     text("oO = Overstrike   - typing mode: overstrike mode",4,0,N_4,-1)
  1061.     text("kK = autobacKup   - keep backup of original when saving file",5,0,N_4,-1)
  1062.     text("rR = Readonly     - file cannot be modified or saved",6,0,N_4,-1)
  1063.     text("wW = wordWrap     - typing mode: auto-wrap lines on word break",7,0,N_4,-1)
  1064.     text("jJ = rightJustify - typing mode: use right justification",8,0,N_4,-1)
  1065.     text("mM = Mapchars     - map illegal chars (ascii 0-3) (See Config! defaults)",9,0,N_4,-1)
  1066.     text("cC = Changed      - file has been modified",10,0,N_4,-1)
  1067.     text("aA = userlocalA   - used for Save On Idle in std config (Config!M)",11,0,N_4,-1)
  1068.     text("bB = userlocalB   - available",12,0,N_4,-1)
  1069.     text("fF = Favorite     - favorite file,: lAmiga-q toggles among favorites",13,0,N_4,-1)
  1070.     text(" ",14,0,3,-1)
  1071.     getKey(N_4)
  1072.     fullRefresh
  1073.     putMsg(" ")
  1074.     putMsg("")
  1075. >
  1076.  
  1077. Save Uedit state
  1078. <rAmiga-f5:
  1079.     putMsg("Save state <uestate>:")
  1080.     clearBuf(B_4)
  1081.     if (!inputString(B_4)) insertRgn(B_4,efile,"uestate",all)
  1082.     if (askYesNo("Overwrite existing state file?")) saveState(B_4)
  1083. >
  1084.  
  1085. Load Uedit state
  1086. <rAmiga-f6:
  1087.     if (askYesNo("Save changes, if any, before loading state?")) runKey(alt-f2)
  1088.     putMsg("Load state <uestate>:")
  1089.     clearBuf(B_4)
  1090.     if (!inputString(B_4)) insertRgn(B_4,efile,"uestate",all)
  1091.     loadState(B_4)
  1092.  
  1093.     .. load out of date files if any
  1094.     push(NSTACK_99,N_10)
  1095.     push(NSTACK_99,N_11)
  1096.     push(NSTACK_99,N_12)
  1097.     push(NSTACK_99,N_13)
  1098.     getMaxFiles(N_11)
  1099.     decNum(N_11)
  1100.     equateNum(N_12,0)
  1101.     equateNum(N_13,curFile)
  1102.     do (N_10,0,N_11) {
  1103.         if (getFlag(buf[N_10],readOnly)) {
  1104.             editBuf(buf[N_10])
  1105.             if (eqNum(N_12,0)) {
  1106.                 if (askYesNo("Load new versions of files?")) equateNum(N_12,1)
  1107.                 else goto label(0)
  1108.             }
  1109.             if (eqNum(N_12,1)) runKey(shftCtl-f1)
  1110.         }
  1111.     }
  1112.  
  1113.     label(0)
  1114.     editBuf(buf[N_13])
  1115.     pop(NSTACK_99,N_13)
  1116.     pop(NSTACK_99,N_12)
  1117.     pop(NSTACK_99,N_11)
  1118.     pop(NSTACK_99,N_10)
  1119. >
  1120.  
  1121. List files in editor, click name of file to switch to
  1122. <ctl-gadget2:
  1123.    putmsg(" ")
  1124.    text(" ",1,0,1,-1)
  1125.    text("  CLICK FILE NAME TO SELECT",2,0,1,-1)
  1126.    equateNum(N_13,2)
  1127.    equateNum(N_14,0)
  1128.    getMaxFiles(N_10)
  1129.    do(N_11,1,N_10) {     ..push [0..max]
  1130.       sub(N_12,N_11,1)
  1131.       freeBuf(B_0)
  1132.       if (getFileName(B_0,buf[N_12])) {
  1133.          incNum(N_13)
  1134.          incNum(N_14)
  1135.          text(" ",N_13,0,1,1) text(N_11,N_13,1,0,2) text("  ",N_13,3,0,0)
  1136.          text(B_0,N_13,5,0,-1)
  1137.          text(" ",N_13,-1,0,-1) text(" ",N_13,79,1,-1)
  1138.          push(N_12,N_12) } }
  1139.    incNum(N_13)
  1140.    text(" ",N_13,0,1,-1)
  1141.    getKey(N_4)
  1142.    if (mouseDown) {
  1143.        getfont(B_4,N_3,N_4)       .. need fontY
  1144.        freeBuf(B_4)
  1145.        mouseXY(N_15,N_16)
  1146.        div(N_16,N_16,N_4)
  1147.        sub(N_16,N_16,3)
  1148.        do(N_11,1,N_14) {          ..N_11=[1..N_14]
  1149.           sub(N_17,N_14,N_11)
  1150.           add(N_17,N_17,1)        ..N_17=[N_14..1]
  1151.           pop(N_12,N_12)          ..pop buf# for fileName row [N_14..1]
  1152.           freeBuf(B_0)
  1153.           toWord(B_0,N_17)
  1154.           insertChar(B_0," ")
  1155.           toWord(B_0,N_12)
  1156.           if (eqNum(N_17,N_16)) editBuf(buf[N_12]) }
  1157.    }
  1158.    fullRefresh
  1159.    putmsg(" ")
  1160. >
  1161.  
  1162. Show current values of line-length, lines/page, tab-table #, colors, etc
  1163. <shft-help:
  1164.     putMsg("")
  1165.     equateLoc(curfile,locA,atCursor)
  1166.     moveCursor(curfile,sFile)
  1167.     moveCursor(curfile,eLine)
  1168.     copyChar(curfile,N_2)
  1169.     moveCursor(curfile,locA)
  1170.     ..updateDisplay
  1171.     equateNum(N_1,curFile)
  1172.     text(" ",0,0,0,-2)
  1173.     text("Serial number:                       Search wildcard :",2,0,0,0)
  1174.     text("Buffer       :                       \"\"   multiWild  :",3,0,0,0)
  1175.     text("Size         :                       \"\"      allBut  :",4,0,0,0)
  1176.     text("Line length  :                       \"\"    eitherOr  :",5,0,0,0)
  1177.     text("Lines/page   :                       \"\" singleWhite  :",6,0,0,0)
  1178.     text("Tab table    :                       \"\"  multiWhite  :",7,0,0,0)
  1179.     text("Left margin  :                       Idle timer      :",8,0,0,0)
  1180.     text("Top margin   :                       PM terminator   :",9,0,0,0)
  1181.     text("Bottom margin:                       Max files       :",10,0,0,0)
  1182.     text("End-of-line  :                       Printer select  :",11,0,0,0)
  1183.     text("Color bits   :                       capsLock        :",12,0,0,0)
  1184.     text("Split size   :",13,0,0,0)
  1185.  
  1186.     text("Values for this buffer",1,0,0,0)
  1187.     getSerialNum(N_4)
  1188.     text(N_4,2,16,8,0)
  1189.     text(N_1,3,16,8,0)  ..buffer number
  1190.     getLocal(curFile,N_4,lineLength)
  1191.     text(N_4,5,16,8,0)
  1192.     getLocal(curFile,N_4,pageLines)
  1193.     text(N_4,6,16,8,0)
  1194.     getLocal(curFile,N_4,tabTable)
  1195.     text(N_4,7,16,8,0)
  1196.     getLocal(curFile,N_4,leftMargin)
  1197.     text(N_4,8,16,8,0)
  1198.     getLocal(curFile,N_4,topMargin)
  1199.     text(N_4,9,16,8,0)
  1200.     getLocal(curFile,N_4,bottomMargin)
  1201.     text(N_4,10,16,8,0)
  1202.     text(N_2,11,16,8,0) .. eol, copied it above
  1203.     freeBuf(B_3)
  1204.     getLocal(curFile,N_10,color)
  1205.     toWord(B_3,N_10)
  1206.     movecursor(B_3,sfile)
  1207.     hexDecimal(B_3)
  1208.     text(B_3,12,16,8,0)
  1209.     text(splitSize,13,16,8,0)
  1210.     freeBuf(B_3)
  1211.     insertChar(B_3,wildCard)
  1212.     text(B_3,2,56,8,0)
  1213.     freeBuf(B_3)
  1214.     insertChar(B_3,multiWild)
  1215.     text(B_3,3,56,8,0)
  1216.     freeBuf(B_3)
  1217.     insertChar(B_3,allBut)
  1218.     text(B_3,4,56,8,0)
  1219.     freeBuf(B_3)
  1220.     insertChar(B_3,eitherOr)
  1221.     text(B_3,5,56,8,0)
  1222.     text(singleWhite,6,56,8,0)
  1223.     text(multiWhite,7,56,8,0)
  1224.     text(idleTime,8,56,8,0)
  1225.     text(pmESC,9,56,8,0)
  1226.     getMaxFiles(N_4)
  1227.     text(N_4,10,56,8,0)
  1228.     text(prefPrint,11,56,8,0)
  1229.     if (!eqNum(capsLock,0)) text("YES",12,56,3,0)
  1230.     else text("no",12,56,8,0)
  1231.     putMsg("Any key to continue")
  1232.     fileSize(curFile,N_4)
  1233.     text(N_4,4,16,8,0)
  1234.     getKey(N_4)
  1235.     putMsg("")
  1236.     refreshDisplay>
  1237.  
  1238. Insert date-time-stamp at cursor
  1239. <rAmiga-0:
  1240.     clearBuf(B_4)
  1241.     clearBuf(B_3)
  1242.     insertRgn(B_4,eFile,"date",all)
  1243.     execute(B_3,B_4)
  1244.     moveCursor(B_3,eFile)
  1245.     moveCursor(B_3,sChar)
  1246.     clearChar(B_3)
  1247.     ..insertchar(B_3," ")
  1248.     insertRgn(curFile,atCursor,B_3,all)
  1249.     >
  1250.  
  1251. Save key command of next key pressed to RAM:pData
  1252. <rAmiga-8:
  1253.     putMsg("Press key to save:")
  1254.     if (getKey(N_4)) saveKeys("RAM:pData",N_4,0)
  1255.     putMsg("")
  1256. >
  1257.  
  1258. Restore key command of next key pressed from RAM:pData
  1259. <rAmiga-9:
  1260.     putMsg("Press key to restore:")
  1261.     if (getKey(N_4)) loadKeys("RAM:pData",N_4,0)
  1262.     putMsg("")
  1263. >
  1264.  
  1265. Swap current file with next file
  1266. <ramiga-6:
  1267.     equateNum(N_4,curFile)
  1268.     toggle(curFile)
  1269.     swapBuf(buf[N_4],curFile)
  1270. >
  1271.  
  1272. Compare curFile with buffer 41 from cursor forward (see Ctl-w)
  1273. <rAmiga-7:
  1274.     compareBuf(curFile,SWAP_BUF)
  1275.     swapBuf(curFile,SWAP_BUF)
  1276.     swapBuf(curFile,SWAP_BUF)
  1277.     swapBuf(curFile,SWAP_BUF)
  1278.     swapBuf(curFile,SWAP_BUF)
  1279. >
  1280.  
  1281. Modify existing search text and then search
  1282. <shft-f7:
  1283.     define(Get_Next_Input        ,label(0))
  1284.     define(Process_Input        ,label(1))
  1285.     define(Take_It_Literally    ,label(2))
  1286.     define(Take_Literally        ,label(3))
  1287.     define(Search_And_Continue  ,label(9))
  1288.     define(Do_Search            ,label(50))
  1289.     define(Show_Search_Str      ,label(51))
  1290.     define(Search_Success        ,N_0)
  1291.     define(Was_BackSlash        ,N_1)
  1292.     define(Fwd_Searching        ,N_2)
  1293.  
  1294.     if (eqNum(userGlobalD,0)) {
  1295.         putMsg("Input search string:")
  1296.         inputString(SEARCH_STR)
  1297.         setSearch(SEARCH_STR)
  1298.         runKey(normal-f9)
  1299.         return
  1300.     }
  1301.     equateLoc(curfile,locA,atcursor)
  1302.     equateNum(Search_Success,0)     .. indicates success of search
  1303.     equateNum(Was_BackSlash,0)      .. indicates last char was a backslash
  1304.     equateNum(Fwd_Searching,1)      .. forward searching
  1305.     equateNum(searchCaps,0)
  1306.     freeBuf(B_4)
  1307.     insertRgn(B_4,eFile,"INPUT SEARCH STRING (pmESC or click to quit):",all)
  1308.     GOSUB Show_Search_Str
  1309.  
  1310.     while (nothing) {
  1311. Get_Next_Input
  1312.         getKeyVal(N_4,N_3)
  1313. Process_Input
  1314.         if (eqNum(N_4,normal-upArrow) | eqNum(N_4,shft-f9)) {
  1315.             equateNum(Fwd_Searching,-1)
  1316.             GOTO Search_And_Continue
  1317.         }
  1318.         if (eqNum(N_4,normal-downArrow) | eqNum(N_4,normal-f9)) {
  1319.             equateNum(Fwd_Searching,1)
  1320.             GOTO Search_And_Continue
  1321.         }
  1322.  
  1323.         if (eqNum(N_4,normal-buttonUp) | eqNum(N_4,normal-closebox))
  1324.             equateNum(N_3,pmESC)
  1325.         if (eqNum(N_3,pmESC)) {
  1326.             if (eqNum(Was_BackSlash,1)) GOTO Take_It_Literally .. take it
  1327.             if (eqNum(Search_Success,0)) {
  1328.                 putMsg("Search failed")
  1329.                 equateLoc(curFile,sinvert,einvert)
  1330.                 moveCursor(curfile,locA)
  1331.                 updateDisplay
  1332.                 returnFalse
  1333.             }
  1334.             putMsg("")
  1335.             returnTrue
  1336.         }
  1337.  
  1338.         switch(N_3) {
  1339.             case("\\")   {  if (eqNum(Was_BackSlash,1)) GOTO Take_It_Literally
  1340.                             equatenum(Was_BackSlash,1)  .. take next char literally
  1341.                             GOTO Take_Literally
  1342.                          }
  1343.             case(eitherOr)
  1344.             case(allBut) {
  1345.                             if (eqNum(Was_BackSlash,0)) {
  1346.                                 moveCursor(curfile,locA)
  1347.                                 equateNum(Search_Success,0) .. search failed status
  1348.                             }
  1349.                             GOTO Take_It_Literally
  1350.                          }
  1351.             case(0)      { GOTO Get_Next_Input }
  1352.             case(8)      {                           .. backspace
  1353.                             if (eqNum(Was_BackSlash,1)) GOTO Take_It_Literally
  1354.                             moveCursor(curFile,locA)
  1355.                             equateNum(Search_Success,0)
  1356.                             moveCursor(SEARCH_STR,sChar)
  1357.                             clearChar(SEARCH_STR)
  1358.                             while (inputWaiting) {
  1359.                                 getKeyVal(N_4,N_3)
  1360.                                 if (!eqNum(N_3,8)) {
  1361.                                     GOSUB Show_Search_Str
  1362.                                     GOSUB Do_Search
  1363.                                     updateDisplay
  1364.                                     GOTO Process_Input
  1365.                                 }
  1366.                                 moveCursor(SEARCH_STR,sChar)
  1367.                                 clearChar(SEARCH_STR)
  1368.                             }
  1369.                          }
  1370.             default      {
  1371. Take_It_Literally                                        .. whatever it is
  1372.                             if (eqNum(Was_BackSlash,1)) {
  1373.                                 moveCursor(curFile,locA)
  1374.                                 equateNum(Was_BackSlash,0)  .. reset backslash flag
  1375.                             }
  1376. Take_Literally
  1377.                             if (geNum(N_3,"A") & geNum("Z",N_3)) {
  1378.                                 equateNum(searchCaps,1)
  1379.                                 moveCursor(curFile,locA)
  1380.                                 equateNum(Search_Success,0)
  1381.                             }
  1382.                             insertChar(SEARCH_STR,N_3)
  1383.                             .. if last search succeeded, back up and rehit
  1384.                             if (eqNum(Search_Success,1)) {
  1385.                                 if (eqNum(Fwd_Searching,1)) moveCursor(curFile, sChar)
  1386.                                 else {
  1387.                                     moveCursor(curFile, eInvert)
  1388.                                     moveCursor(curFile, eChar)
  1389.                                 }
  1390.                             }
  1391.                          }
  1392.         }
  1393.         GOSUB Show_Search_Str
  1394. Search_And_Continue
  1395.         GOSUB Do_Search
  1396.         updateDisplay
  1397.     }
  1398.  
  1399. Do_Search  .. SUBROUTINE to search fwd or bkwd depending on flag
  1400.     setSearch(SEARCH_STR)
  1401.     if (search(curFile,sInvert,eInvert,Fwd_Searching)) equateNum(Search_Success,1)
  1402.     else {
  1403.         equateloc(curfile,einvert,sinvert)
  1404.         equateNum(Search_Success,0) .. search failed status
  1405.         moveCursor(curFile,locA)
  1406.     }
  1407.     return
  1408.  
  1409. Show_Search_Str .. SUBROUTINE to display search string
  1410.     freeBuf(B_3)
  1411.     insertRgn(B_3,efile,B_4,all)
  1412.     insertRgn(B_3,efile,SEARCH_STR,all)
  1413.     putMsg(B_3)
  1414. >
  1415.  
  1416. Use scroll gadget
  1417. <normal-middleDown:
  1418.     equateNum(N_7,2)        .. color 4 or 7 or whatever
  1419.     locToLine(curfile,N_3,efile)        .. get # lines in file
  1420. ..    getSplitLines(N_0,N_1)
  1421. ..    sub(N_1,N_1,N_0)
  1422. ..    sub(N_3,N_3,N_1)
  1423.  
  1424.     div(N_3,N_3,400)                    .. lines per pixel
  1425.     if (geNum(0,N_3)) equateNum(N_3,1)
  1426.     incNum(N_3)
  1427.     if (not mouseDown) goto label(99)
  1428.     putMsg(" ")
  1429.  
  1430.     getFont(B_4,N_1,N_2)  .. font x & y
  1431.     freebuf(B_4)          .. don't need this
  1432.     add(N_1,N_2,N_2)        .. N_1 = 2 * fontY
  1433.     add(N_2,N_2,2)          .. N_2 = fontY + 2
  1434.  
  1435.     decNum(N_1)
  1436.  
  1437.     mouseXY(N_4,N_11)
  1438.     if (gtNum(N_4,400)) equateNum(N_4,400)
  1439.     equateNum(N_0,N_4)
  1440.  
  1441.     gosub label(50)         .. draw gadget button
  1442.  
  1443.     goto label(98)
  1444.     while (not inputWaiting) {
  1445.         trackMouse
  1446.         mouseXY(N_4,N_11)
  1447.         if (gtNum(N_4,400)) equateNum(N_4,400)
  1448.         if (!eqNum(N_0,N_4)) {
  1449.             equateNum(N_6,N_4)
  1450.             equateNum(N_4,N_0)
  1451.             gosub label(50)
  1452.             equateNum(N_4,N_6)
  1453.  
  1454.             equateNum(N_0,N_4)      .. redraw gadget button
  1455.             gosub label(50)
  1456. label(98)
  1457.             mul(N_4,N_4,N_3)        .. mul by lines per granule
  1458.             if (eqNum(N_4,0)) equateNum(N_4,1)
  1459.             lineToLoc(curFile,atCursor,N_4)
  1460.             vscroll(atCursor)
  1461.             updateDisplay
  1462.         }
  1463.         if (not mouseDown) goto label(99)
  1464.     }
  1465. label(99)
  1466.     putMsg(" ")
  1467.     return
  1468.  
  1469.     label(50)        .. SUBROUTINE:  DRAW SCROLL BUTTON FOR SCROLL GADGET
  1470.     text("....1....2....3....4....5....6....7....8....9....10",0,0,N_7,0)
  1471.     draw(N_4,N_2,N_7,0,0)
  1472.     draw(N_4,N_1,N_7,0,1)
  1473.     add(N_5,N_4,1)
  1474.     draw(N_5,N_2,N_7,0,0)
  1475.     draw(N_5,N_1,N_7,0,1)
  1476.     incNum(N_5)
  1477.     draw(N_5,N_2,N_7,0,0)
  1478.     draw(N_5,N_1,N_7,0,1)
  1479. >
  1480.  
  1481. Apropos - search for specified string in Help-Key (by Tony Sumrall)
  1482. <rAmiga-5: .. (ACS change - new command)
  1483.         freeBuf(B_3)
  1484.         freeBuf(B_0)
  1485.         putMsg("Input search string:")
  1486.         if (!inputString(B_3) | isEmpty(B_3)) returnFalse
  1487.         if(   not insertFile(B_0,eFile,"Help-Key")
  1488.             & not insertFile(B_0,eFile,"S:Help-Key")
  1489.             & not insertFile(B_0,eFile,"RAM:Help-Key")
  1490.             & not insertFile(B_0,eFile,"U:Help-Key") ) {
  1491.                 putMsg("Can't find Help-Key file")
  1492.                 returnFalse
  1493.         }
  1494.  
  1495.         putMsg("Searching...")
  1496.         equateLoc(B_0, locA, atCursor)
  1497.         getSearch(SEARCH_STR)
  1498.         setSearch(B_3)
  1499.         while(search(B_0,sInvert,eInvert,1)) {
  1500.             moveCursor(B_0, sInvert)
  1501.             if(not is(B_0, sLine)) moveCursor(B_0, sLine)
  1502.             equateLoc(B_0, locB, atCursor)
  1503.             if(not eqLoc(B_0, atCursor, locA)) clearRgn(B_0, loc)
  1504.             moveCursor(B_0, locB)
  1505.             moveCursor(B_0, downLine)
  1506.             if(is(B_0, eFile)) goto label(1)
  1507.             equateLoc(B_0, locA, atCursor)
  1508.         }
  1509. label(1)
  1510.         if(not is(B_0, eFile)) {
  1511.             equateLoc(B_0, locB, eFile)
  1512.             equateLoc(B_0, locA, atCursor)
  1513.             clearRgn(B_0, loc)
  1514.             ..
  1515.             if(eqLoc(B_0,sFile,eFile)) {          .. these few lines are a
  1516.                 beepDisplay                         .. patch by P. Obminski
  1517.                 putMsg("Nothing found apropos ")
  1518.                 text( B_3, 0, 22, 4, 0 )
  1519.                 while(!inputWaiting) delay(5)  .. .. ..  <-- help yourself!
  1520.                 returnFalse
  1521.             }
  1522.             ..                                      PATCH END
  1523.         }
  1524.  
  1525.         setSearch(SEARCH_STR)
  1526.         equateLoc(B_0, sInvert, eInvert)
  1527.         upFlag(B_0, readOnly)
  1528.         downFlag(B_0, changed)
  1529.         moveCursor(B_0, sFile)
  1530.         editBuf(B_0)
  1531.         refreshDisplay
  1532.         fileSize(B_0,N_4) .. force pack
  1533.         putMsg("done")
  1534. >
  1535.  
  1536. Match braces or parens (by Tom Zartler)
  1537. <rAmiga-4:  getSearch(SEARCH_STR)  ..save search string
  1538. label(0)
  1539.             freeBuf(B_4)
  1540.             insertChar(B_4,eitherOr)
  1541.             if (is(curFile,"{")) {
  1542.                 insertRgn(B_4,sFile,"{",all)  ..put braces in B_4
  1543.                 insertRgn(B_4,eFile,"}",all)
  1544.             } else if (is(curFile,"(")) {
  1545.                 insertRgn(B_4,sFile,"(",all)  ..put parens in B_4
  1546.                 insertRgn(B_4,eFile,")",all)
  1547.             } else {
  1548.                 insertChar(B_4,"{")
  1549.                 insertChar(B_4,eitherOr)
  1550.                 insertChar(B_4,"(")
  1551.                 setSearch(B_4)
  1552.                 if (!search(curfile,locA,locB,1)) {
  1553.                     putMsg("Cursor not set on a left brace or paren.")
  1554.                     setSearch(SEARCH_STR)
  1555.                     return
  1556.                 }
  1557.                 goto label(0)
  1558.             }
  1559.             equateLoc(curFile,sInvert,atCursor)
  1560.             equateLoc(curFile,eInvert,sInvert)
  1561.  
  1562.             setSearch(B_4)
  1563.             equateNum(N_4,1)  ..use N_4 as depth counter
  1564.             while( not eqNum(N_4,0)) {
  1565.               if ( not search(curFile,locA,locB,1)) {
  1566.                 setSearch(SEARCH_STR)
  1567.                 moveCursor(curFile,sInvert) ..put cursor back where we started
  1568.                 putMsg("No matching brace found.")
  1569.                 return
  1570.               }
  1571.               if ( is(curFile,123)) incNum(N_4)
  1572.               else if ( is(curFile,40)) incNum(N_4)
  1573.               else decNum(N_4)
  1574.             }
  1575.             setSearch(SEARCH_STR)  ..restore search string
  1576.             moveCursor(curFile,echar)
  1577.             if (getFlag(curFile,columnar)) flipFlag(curFile,columnar)
  1578.             equateLoc(curFile,eInvert,atCursor)
  1579.             refreshDisplay
  1580. >
  1581.  
  1582.  
  1583. Make an in-use keytable (by Kurt Wessels)
  1584. <rAmiga-1:
  1585. putMsg("Creating key table, please wait...")
  1586. freeBuf(B_0)
  1587. insertRgn(B_0,eFile,
  1588. "1 !      1
  1589. 2 @      2
  1590. 3 #      3
  1591. 4 $      4
  1592. 5 %      5
  1593. 6 ^      6
  1594. 7 &      7
  1595. 8 *      8
  1596. 9 (      9
  1597. 0 )     10
  1598. - _     11
  1599. = +     12
  1600. \ |     13
  1601. UNUSED  14
  1602. kp0     15
  1603. Q       16
  1604. W       17
  1605. E       18
  1606. R       19
  1607. T       20
  1608. Y       21
  1609. U       22
  1610. I       23
  1611. O       24
  1612. P       25
  1613. [ {     26
  1614. ] }     27
  1615. UNUSED  28
  1616. kp1     29
  1617. kp2     30
  1618. kp3     31
  1619. A       32
  1620. S       33
  1621. D       34
  1622. F       35
  1623. G       36
  1624. H       37
  1625. J       38
  1626. K       39
  1627. L       40
  1628. ; :     41
  1629. ' \"\"    42
  1630. UNUSED  43
  1631. UNUSED  44
  1632. kp4     45
  1633. kp5     46
  1634. kp6     47
  1635. UNUSED  48
  1636. Z       49
  1637. X       50
  1638. C       51
  1639. V       52
  1640. B       53
  1641. N       54
  1642. M       55
  1643. , <     56
  1644. . >     57
  1645. / ?     58
  1646. UNUSED  59
  1647. kp.     60
  1648. kp7     61
  1649. kp8     62
  1650. kp9     63
  1651. Space   64
  1652. BS      65
  1653. Tab     66
  1654. kpEnter 67
  1655. Return  68
  1656. ESC     69
  1657. DEL     70
  1658. menuDown71
  1659. menuUp  72
  1660. middleDn73
  1661. kpMinus 74
  1662. middleUp75
  1663. upArrow 76
  1664. dnArrow 77
  1665. rtArrow 78
  1666. lftArrow79
  1667. F1      80
  1668. F2      81
  1669. F3      82
  1670. F4      83
  1671. F5      84
  1672. F6      85
  1673. F7      86
  1674. F8      87
  1675. F9      88
  1676. F10     89
  1677. kpLParen90
  1678. kpRParen91
  1679. kpSlash 92
  1680. kpStar  93
  1681. kpPlus  94
  1682. Help    95
  1683. buttonDn96
  1684. buttonUp97
  1685. Gadget1-98
  1686. Gadget2-99
  1687. Gadg3--100
  1688. Gadg4--101
  1689. CloseBx102
  1690. ` ~    103
  1691. UNUSED 104
  1692. ",all)
  1693.     editBuf(B_0)
  1694.     equateNum(N_0,0)  .. outer loop prefix counter
  1695.     do (N_0,0,10) {
  1696.         moveCursor(B_0,sFile) vScroll(sFile) refreshDisplay
  1697.         do(N_8,1,104) {  .. inner loop key counter
  1698.             mul(N_7,N_0,104)  .. prefix,
  1699.             add(N_7,N_7,N_8)  .. plus key, gives value
  1700.             moveCursor(B_0,eLine)
  1701.             insertChar(B_0," ")
  1702.             if (inUse(N_7)) insertChar(B_0,"X") else insertChar(B_0,"-")
  1703.             insertRgn(B_0,atCursor,"   ",all)
  1704.        }
  1705.     }
  1706.     ..equateLoc(B_0,eHilite,sFile)
  1707.     insertRgn(B_0,sFile,"
  1708.  
  1709.              Master keytable for current status of Uedit
  1710.  
  1711.     X Key in use     - Key not in use      UNUSED unassigned keycode
  1712.  
  1713.           Any specific key value is: (prefix * 104) + KeyCode
  1714.  
  1715. KeyName    Norm Shft Alt  SA   Ctl  SC   AC   SAC  lAmi rAmi Virtual
  1716. |  KeyCode |0    |1   |2   |3   |4    |5   |6   |7   |8    |9   |10    {-- Prefix
  1717. |         | |    |     |    |    |    |     |    |    |    |     |
  1718.  
  1719. ",all)
  1720.     ..equateLoc(curFile,sHilite,sFile)
  1721.     vscroll(sFile)
  1722.     downFlag(curFile,changed)
  1723.     refreshDisplay
  1724.     putMsg("")
  1725. >
  1726.  
  1727. See number of buffers and bytes on stacks, change stacking flags
  1728. <rAmiga-2:
  1729.     define(B_COLORS,1)
  1730.     define(H_COLORS,1)
  1731.     define(O_COLORS,4)
  1732. label(0)
  1733.     text("Name       Buf#   Bufs on Stack      Total Bytes    STACKING LIMIT",
  1734.         1,0,B_COLORS,-1)
  1735.     equateNum(N_1,2)
  1736.     equateNum(N_8,0)
  1737.     equateNum(N_7,0)
  1738.     equateNum(N_5,0)
  1739.     freeBuf(B_2)
  1740.     freeBuf(B_4)
  1741.     do (N_0,0,99) {
  1742.         equateNum(N_3,N_0)
  1743.         equateNum(N_4,N_0)
  1744.         getStackSize(N_4,N_3,N_2)
  1745.         add(N_7,N_7,N_4)
  1746.         freeBuf(B_4)
  1747.         switch(N_0) {
  1748.         case(37) { insertRgn(B_4,eFile,"Columnar",all) }
  1749.         case(45) { insertRgn(B_4,eFile,"Scratch",all) }
  1750.         case(46) { insertRgn(B_4,eFile,"Invert",all) }
  1751.         case(47) { insertRgn(B_4,eFile,"Hilite",all) }
  1752.         case(48) { insertRgn(B_4,eFile,"Replace",all) }
  1753.         case(49) { insertRgn(B_4,eFile,"Search",all) }
  1754.         case(99) { insertRgn(B_4,eFile,"Push Pop",all) }
  1755.         default { goto label(1) }
  1756.         }
  1757.         text(B_4,N_1,0,B_COLORS,-1)
  1758.         text(N_0,N_1,11,B_COLORS,0)
  1759.         text(":",N_1,15,B_COLORS,0)
  1760.  
  1761.         if (!eqNum(N_4,0)) text(N_4,N_1,18,H_COLORS,0)
  1762. ..        else text(N_4,N_1,18,B_COLORS,0)
  1763.         equateNum(N_3,N_4)  .. store the number of buffers
  1764.  
  1765.         equateNum(N_11,0)
  1766.         freeBuf(B_3)
  1767.         if (gtNum(N_4,0)) {
  1768.             while (decNum(N_4)) {
  1769.                 pop(buf[N_0],B_3)
  1770.                 fileSize(B_3,N_10)
  1771.                 add(N_11,N_11,N_10)
  1772.                 push(buf[N_0],B_3)
  1773.                 rollstack(buf[N_0],1)
  1774.             }
  1775.         }
  1776.         if (!eqNum(N_11,0)) text(N_11,N_1,37,H_COLORS,0)
  1777.         add(N_8,N_8,N_11)
  1778.  
  1779.         .. compute buffer overhead
  1780.         .. N_3=#buffers in stack
  1781.         .. N_11=total bytes of text in all bufs in stack
  1782.  
  1783.         mul(N_2,N_3,274)    .. header+stack o/h for all bufs on stack
  1784.  
  1785.         div(N_4,N_11,244)     .. calc min # blocks used
  1786.         add(N_4,N_4,N_3)    .. add 1 extra for each buffer for right answer
  1787.         mul(N_4,N_4,12)     .. block o/h
  1788.  
  1789.         add(N_4,N_4,N_2)
  1790.         add(N_5,N_5,N_4)
  1791.  
  1792.         if (!eqNum(N_0,99)) {
  1793.             text("   ",N_1,52,O_COLORS,0)
  1794.             equateNum(N_4,-2)
  1795.             stackBuf(buf[N_0],N_4)
  1796.             text(N_4,N_1,52,O_COLORS,0)
  1797.  
  1798.             sub(N_4,N_1,1)
  1799.             freeBuf(B_4)
  1800.             insertChar(B_4,"F")
  1801.             add(N_4,N_4,48)
  1802.             insertChar(B_4,N_4)
  1803.             text(B_4,N_1,56,B_COLORS,0)
  1804.         }
  1805.         incNum(N_1)
  1806. label(1)
  1807.         nothing
  1808.     }
  1809.  
  1810.     text(" ",N_1,0,B_COLORS,-1)
  1811.     text("--------",N_1,18,B_COLORS,0)
  1812.     text("--------",N_1,37,B_COLORS,0)
  1813.     text("SEE STACK BUFFERS",N_1,52,O_COLORS,0)
  1814.     text("F8",N_1,71,B_COLORS,0)
  1815.  
  1816.     incNum(N_1)
  1817.     text("TOTALS:",N_1,0,B_COLORS,-1)
  1818.     if (!eqNum(N_7,0)) text(N_7,N_1,18,H_COLORS,0)        .. total # buffers
  1819.     if (!eqNum(N_8,0)) text(N_8,N_1,37,H_COLORS,0)        .. total data bytes
  1820.  
  1821.  
  1822.     putMsg("Click a STACKING LIMIT or SEE STACK BUFFERS.   Any key to quit.")
  1823.  
  1824.     text(" ", 11,0,B_COLORS,-1)
  1825.  
  1826. label(98)
  1827.     runKey(Eat_MouseUp_Input) .. soak mouseUp
  1828.  
  1829.     getKey(N_4)
  1830.     equateNum(N_11,53)
  1831.     if (!mouseDown) {
  1832.         switch(N_4) {
  1833.         case(normal-f1) { equateNum(N_3,3) goto label(96) }
  1834.         case(normal-f2) { equateNum(N_3,4) goto label(96) }
  1835.         case(normal-f3) { equateNum(N_3,5) goto label(96) }
  1836.         case(normal-f4) { equateNum(N_3,6) goto label(96) }
  1837.         case(normal-f5) { equateNum(N_3,7) goto label(96) }
  1838.         case(normal-f6) { equateNum(N_3,8) goto label(96) }
  1839.         case(normal-f8) { goto label(95) }
  1840.         default { goto label(99) }
  1841.         }
  1842.  
  1843.     }
  1844.     mouseXY(N_11,N_3)         .. x & y
  1845.     runKey(Eat_MouseUp_Input)              .. soak mouseUp
  1846.  
  1847.     getFont(B_4,N_2,N_1)  .. x & y
  1848.     freeBuf(B_4)
  1849.     div(N_3,N_3,N_1)
  1850.     div(N_11,N_11,N_2)
  1851.  
  1852. label(96)
  1853.     switch(N_3) {
  1854.         case (3)  { equateNum(N_0,37) }
  1855.         case (4)  { equateNum(N_0,45) }
  1856.         case (5)  { equateNum(N_0,46) }
  1857.         case (6)  { equateNum(N_0,47) }
  1858.         case (7)  { equateNum(N_0,48) }
  1859.         case (8)  { equateNum(N_0,49) }
  1860.         case (10) { if (gtNum(52,N_11) | gtNum(N_11,72)) goto label(99)
  1861. label(95)
  1862.                     fullRefresh
  1863.                     runKey(rAmiga-3)
  1864.                     goto label(0)
  1865.                   }
  1866.         default   { goto label(99) }
  1867.     }
  1868.  
  1869. .. check mouse X here, must be in range
  1870.     if (gtNum(52,N_11) | gtNum(N_11,57)) goto label(99)
  1871.  
  1872.     if (stackBuf(buf[N_0],-2)) stackBuf(buf[N_0],0)     .. toggle status
  1873.     else                       stackBuf(buf[N_0],10)
  1874.  
  1875.     decNum(N_3)
  1876.  
  1877.     equateNum(N_4,-2)
  1878.     stackbuf(buf[N_0],N_4)
  1879.     text("   ",N_3,52,O_COLORS,0)
  1880.     text(N_4,N_3,52,O_COLORS,0)
  1881.  
  1882.     goto label(98)
  1883.  
  1884. label(99)
  1885.     putMsg("")
  1886.     fullRefresh
  1887. >
  1888.  
  1889. Scan a buffer stack, select current buffer, delete one or all buffers
  1890. <rAmiga-3:
  1891.     define(COLOR_0,0)
  1892.     define(COLOR_1,2)
  1893.     define(COLOR_2,4)
  1894.     define(COLOR_3,0)
  1895.     define(COLOR_4,8)
  1896. label(20)
  1897.     runKey(Eat_MouseUp_Input)          .. soak mouseUp
  1898.     equateNum(N_10,1)
  1899.     freeBuf(B_4)      .. display buffer names
  1900.     insertRgn(B_4,eFile,"ColumnarF1
  1901. Scratch F2
  1902. Invert  F3
  1903. Hilite  F4
  1904. Replace F5
  1905. Search  F6
  1906. PushPop F7
  1907. ",all)
  1908.     updateDisplay
  1909.     movecursor(B_4,sFile)
  1910.     equateNum(N_11,0)         .. zero the col variable
  1911.     equateNum(N_1,COLOR_2)
  1912.     do (N_4,0,6) {
  1913.         freebuf(B_3)
  1914.         insertRgn(B_3,eFile,B_4,line)
  1915.         text(B_3,0,N_11,N_1,10)
  1916.         if (eqNum(N_1,COLOR_2)) equateNum(N_1,COLOR_3)
  1917.         else equateNum(N_1,COLOR_2)
  1918.         add(N_11,N_11,10)      .. col += 10
  1919.         moveCursor(B_4,downLine)
  1920.     }
  1921.     text("<-- click",0,-1,COLOR_0,-1)
  1922.     text("",1,0,COLOR_4,-1)
  1923.     runKey(Eat_MouseUp_Input)              .. soak mouseUp
  1924.  
  1925.     getKeyVal(N_4,N_3)      .. get a mouse input
  1926.     putMsg(" ")
  1927.     putMsg("")
  1928.     switch(N_4) {     .. make sure input is a msg-line click
  1929.         case(normal-gadget1)
  1930.         case(normal-gadget2)
  1931.         case(normal-gadget3)
  1932.         case(normal-gadget4) { mouseXY(N_9,N_4)
  1933.                                runKey(Eat_MouseUp_Input)             .. soak mouseUp
  1934.                                getFont(B_4,N_3,N_4)
  1935.                                mul(N_3,N_3,10)
  1936.                                div(N_9,N_9,N_3)
  1937.                              }
  1938.         case(normal-f1)      { equateNum(N_9,0) }
  1939.         case(normal-f2)      { equateNum(N_9,1) }
  1940.         case(normal-f3)      { equateNum(N_9,2) }
  1941.         case(normal-f4)      { equateNum(N_9,3) }
  1942.         case(normal-f5)      { equateNum(N_9,4) }
  1943.         case(normal-f6)      { equateNum(N_9,5) }
  1944.         case(normal-f7)      { equateNum(N_9,6) }
  1945.         default { fullRefresh returnFalse }
  1946.     }
  1947.     freeBuf(B_0)
  1948.     insertRgn(B_0,eFile,"CURRENT ",all)
  1949.     switch(N_9) {
  1950.         case(0) {equateNum(N_9,37) insertRgn(B_0,eFile,"Columnar",all) }
  1951.         case(1) {equateNum(N_9,45) insertRgn(B_0,eFile,"Scratch",all) }
  1952.         case(2) {equateNum(N_9,46) insertRgn(B_0,eFile,"Invert",all) }
  1953.         case(3) {equateNum(N_9,47) insertRgn(B_0,eFile,"Hilite",all) }
  1954.         case(4) {equateNum(N_9,48) insertRgn(B_0,eFile,"Replace",all) }
  1955.         case(5) {equateNum(N_9,49) insertRgn(B_0,eFile,"Search",all) }
  1956.         case(6) {equateNum(N_9,99) insertRgn(B_0,eFile,"PushPop",all) }
  1957.         default { fullRefresh returnFalse }
  1958.     }
  1959.     insertRgn(B_0,eFile," Buffer ",all)
  1960.     moveCursor(B_0,eFile)
  1961.     toWord(B_0,N_9)
  1962.  
  1963.     freeBuf(B_4)
  1964.     insertRgn(B_4,eFile,"Roll Stack
  1965. Direction
  1966. Free Buf
  1967. Free Stack
  1968. Done
  1969. ",all)
  1970.     movecursor(B_4,sFile)
  1971.     equateNum(N_11,0)
  1972.     equateNum(N_1,COLOR_2)
  1973.     text(" ",0,0,COLOR_0,-1)
  1974.     do (N_4,0,4) {
  1975.         freebuf(B_3)
  1976.         insertRgn(B_3,eFile,B_4,line)
  1977.         text(B_3,0,N_11,N_1,10)
  1978.         if (eqNum(N_1,COLOR_2)) equateNum(N_1,COLOR_3)
  1979.         else equateNum(N_1,COLOR_2)
  1980.         add(N_11,N_11,10)
  1981.         moveCursor(B_4,downLine)
  1982.     }
  1983.     equateNum(N_1,1)
  1984.     while (nothing) {
  1985.         freeBuf(B_1)
  1986.         moveCursor(buf[N_9],sFile)
  1987.         equateNum(N_4,N_1)
  1988.         if (eqNum(N_9,99)) {
  1989.             freeBuf(B_4)
  1990.             freeBuf(B_0)
  1991.             getFileName(B_4,BUF_99)
  1992.             if (!isEmpty(B_4)) {
  1993.                 insertRgn(B_0,eFile,"First Out of Stack 99 = ",all)
  1994.                 insertRgn(B_0,eFile,B_4,all)
  1995.             } else insertChar(B_0," ")
  1996.         }
  1997.         text(B_0,N_4,0,COLOR_1,-1)
  1998.         while (nothing) {
  1999.             incNum(N_4)
  2000.             freeBuf(B_4)
  2001.             if (insertRgn(B_4,eFile,buf[N_9],line)) text(B_4,N_4,0,COLOR_0,-1)
  2002.             else  if (is(buf[N_9],eLine)) text(" ",N_4,0,COLOR_0,-1)
  2003.             else { text(" ",N_4,0,COLOR_0,-1) goto label(24) }
  2004.             if (!is(buf[N_9],eLine)) moveCursor(buf[N_9],eLine)
  2005.             if (!moveCursor(buf[N_9],eChar)) goto label(24)
  2006.             if (eqNum(N_4,12)) {
  2007.                 insertRgn(B_1,eFile,"...MORE...  ",all)
  2008.                 moveCursor(B_1,eFile)
  2009.                 goto label(24)
  2010.             }
  2011.         }
  2012. label(24)
  2013.         incNum(N_4)
  2014.         equateNum(N_0,0)
  2015.         fileSize(buf[N_9],N_0)
  2016.         toWord(B_1,N_0)
  2017.         insertRgn(B_1,eFile," byte(s)",all)
  2018.         text(B_1,N_4,0,COLOR_1,-1)
  2019.         while (geNum(12,N_4)) {
  2020.             incNum(N_4)
  2021.             text(" ",N_4,0,COLOR_0,-1)
  2022.         }
  2023.         ..
  2024.         getKeyVal(N_4,N_3)    .. get a mouse input
  2025.         switch(N_4) {     .. make sure input is a msg-line click
  2026.             case(normal-gadget1)
  2027.             case(normal-gadget2)
  2028.             case(normal-gadget3)
  2029.             case(normal-gadget4) {  mouseXY(N_4,N_3)
  2030.                                     getFont(B_4,N_2,N_3)
  2031.                                     mul(N_3,N_3,10)
  2032.                                     div(N_3,N_4,N_3)
  2033.                                  }
  2034.             case(normal-buttonDown) { equateNum(N_3,0) }
  2035.             case(normal-bs)
  2036.             case(normal-del)        { equateNum(N_3,2) }
  2037.             case(normal-return)
  2038.             case(normal-esc)
  2039.             default                 { equateNum(N_3,4) }
  2040.         }
  2041.         if (eqNum(N_9,49) & !isEmpty(SEARCH_STR)) setSearch(SEARCH_STR)
  2042.         if (eqNum(N_9,99) & !isEmpty(BUF_99)) push(BSTACK_99,BUF_99)
  2043.         runKey(Eat_MouseUp_Input)              .. soak mouseUp
  2044.         ..
  2045.         switch(N_3) {
  2046.             case(0) { goto label(28) }
  2047.             case(1) { if (eqNum(N_10,1)) equateNum(N_10,-1)
  2048.                       else equateNum(N_10,1)
  2049.                     }
  2050. ..NOTE:  when the stack-buffer flag >0 and you try to FREE a buffer, you
  2051. ..do NOT free it.  Instead it is put onto the buffer stack.  So in order to
  2052. ..free the buffer you must set flag=0 temporarily, free the buffer, and then
  2053. ..set flag>0 again to restore the stack-buffer flag status.  That is what
  2054. ..the two cases below are doing.
  2055.  
  2056.             case(2) { equateNum(N_6,-2)
  2057.                       if (stackBuf(buf[N_9],N_6))        .. if saving on stack
  2058.                         stackBuf(buf[N_9],0)     .. turn OFF flag temporarily
  2059.  
  2060.                       if (eqNum(N_9,99)) pop(BSTACK_99,BUF_99)
  2061.                       freeBuf(buf[N_9])
  2062.                       stackBuf(buf[N_9],N_6)     .. restore buf-saving status
  2063. label(28)
  2064.                       if (!gosub label(50)) {
  2065.                         fullRefresh
  2066.                         goto label(20)
  2067.                       }
  2068.                     }
  2069.             case(3) { equateNum(N_6,-2)
  2070.                       if (stackBuf(buf[N_9],N_6))  .. if saving bufs on stack
  2071.                         stackBuf(buf[N_9],0) .. turn OFF stacking temporarily
  2072.  
  2073.                       stackBuf(buf[N_9],-1)                .. clear the stack
  2074.                       freeBuf(buf[N_9])
  2075.  
  2076.                       stackBuf(buf[N_9],N_6)     .. restore buf-saving status
  2077.                       fullRefresh
  2078.                       goto label(20)
  2079.                     }
  2080.             default { fullRefresh
  2081.                       goto label(20)
  2082.                     }
  2083.         }
  2084.     }
  2085.     return
  2086.  
  2087. label(50)    ..SUBROUTINE:  Swap current buffer with stack & roll stack
  2088.     equateNum(N_0,N_9)
  2089.     equateNum(N_11,0)
  2090.     getStackSize(N_0,N_11,N_3)
  2091.     if (eqNum(N_0,0)) {
  2092.         putmsg("buffer stack is empty")
  2093.         delay(5)
  2094.         returnFalse
  2095.     }
  2096.     if (!isEmpty(buf[N_9])) push(buf[N_9],buf[N_9])
  2097.     rollstack(buf[N_9],N_10)
  2098.     pop(buf[N_9],buf[N_9])
  2099. >
  2100.  
  2101. Soak inputs until mouseUp
  2102. <624:        .. "Eat_MouseUp_Input"
  2103.     push(NSTACK_99,N_4)
  2104.     inputKey(N_4)
  2105.     while (mouseDown) { delay(1) inputKey(N_4) }
  2106.     pop(NSTACK_99,N_4)
  2107. >
  2108.  
  2109.  
  2110. <defines: >
  2111.